import config from '@/config'
import RequestBase from '@/utils/request.js'

const baseRequest = new RequestBase(config.safetyUrl)

// 隐患处理待办列表
export function getHiddenDangerDealTodoList(data) {
  return baseRequest.get('/business/app/hidden-danger/manage/todo-list', data)
}

/**
 * @description 隐患审核转办
 */
export function complaintHiddenDangerReview(data) {
  return baseRequest.post(`/business/app/hidden-danger/manage/review-transfer`, data)
}

/**
 * @description 根据所属部门id查看隐患审批人员配置列表
 */
export function managerUserListByDeptId(params) {
  return baseRequest.get(`/business/app/hidden-danger/manage/setting/getInfoByDeptId`, params)
}

// 隐患验收
export function hiddenDangerAccept(data) {
  return baseRequest.put(`/business/app/hidden-danger/manage/acceptance`, data)
}

// 隐患整改
export function hiddenDangerRectify(data) {
  return baseRequest.put(`/business/app/hidden-danger/manage/deal`, data)
}

//管控排查隐患审核
export function hiddenDangerCheckReview(data) {
  return baseRequest.post(`/business/app/hidden-danger/manage/review`, data)
}

//结束管控排查隐患上报
export function cancelHiddenDangerCheckReport(data) {
  return baseRequest.post(`/business/app/hidden-danger/manage/cancel`, data)
}

// 隐患审核转办
export function hiddenDangerTransfer(managerId, data) {
  return baseRequest.put(`/mobile/dbd/hidden-danger-manager/reviewTransfer/${managerId}`, data)
}

//管控排查隐患转办
export function hiddenDangerCheckTransfer(data) {
  return baseRequest.post(`/mobile/dbd/check-plan-task/transfer`, data)
}

// 隐患详情
export function getHiddenDangerInfo(managerId) {
  return baseRequest.get(`/business/app/hidden-danger/manage/detail/${managerId}`)
}

// 派发任务
export function distributeTask(req) {
  return baseRequest.post('/business/app/hidden-danger/manage/dispatch', req)
}

// 转办
export function reportToLeader(req) {
  return baseRequest.post(`/business/app/hidden-danger/manage/transfer`, req)
}

// 退回
export function returnHiddenDanger(req) {
  return baseRequest.post('/mobile/dbd/hidden-danger-handle/return', req)
}

// 管控排查审批
export function checkPlanTaskApprove(req) {
  return baseRequest.post('/business/app/hidden-danger/manage/approve', req)
}

// 管控排查取消
export function checkPlanTaskCancel(req) {
  return baseRequest.post('/mobile/dbd/check-plan-task/cancel', req)
}

// 延期申请
export function delayApply(data) {
  return baseRequest.post(`/dbd/hidden-danger-manager/applyForDelay`, data)
}

// 延期整改信息
export function delayInfo(mangerId) {
  return baseRequest.get(`/dbd/hidden-danger-manager/getDealDelayInfo/${mangerId}`)
}

// 延期审核审批
export function delayApprove(data) {
  return baseRequest.post(`/dbd/hidden-danger-manager/reviewDelayApply`, data)
}
